package org.delay;

import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;

import javax.annotation.PostConstruct;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Classname DelayQueueMessageConsumer
 * @Description 延迟队列消费者
 * @Date 2022/9/14 10:28
 * @Created by wangchangjiu
 */
@Slf4j
public class KafkaDelayQueueMessageConsumer extends DelayQueueMessageConsumer {

    private KafkaSimpleMessageProducer kafkaSimpleMessageProducer;

    public KafkaDelayQueueMessageConsumer(DelayQueueMessage delayQueueMessage,
                                          DelayQueueTopicRegistrar delayQueueTopicRegistrar,
                                          KafkaSimpleMessageProducer kafkaSimpleMessageProducer,
                                          RedissonDelayProperties properties){
        super(delayQueueMessage, delayQueueTopicRegistrar, properties);
        this.kafkaSimpleMessageProducer = kafkaSimpleMessageProducer;
    }

    @Override
    public void processMessages(String topic, Object value) {
        kafkaSimpleMessageProducer.sendSimpleMessage(topic, value);
    }



}
